package demo;

class Quadrangle{
    public static void draw(Quadrangle q){
        //
    }
}
class Square extends Quadrangle{
             //
        }
        class Anything{
            //
        }

public class Parallelogram extends Quadrangle  {
    public static void main(String[] args) {
        Quadrangle q=new Quadrangle();
        if(q instanceof Parallelogram){
            Parallelogram p=(Parallelogram) q;//向下转型

        }
        if(q instanceof  Square){
            Square s=(Square)q;//向下转型
        }

    }

}
